<?php
/**
 * Template Name: About - News Detail
 * Description: The news detail page for About
 *
 * @package ManterRealty
 * 
 */

get_header(); ?>
		
        <div class="kc_wrap kc_section">
        	<?php if ( have_posts() ) : ?>
            	<?php while ( have_posts() ) : the_post(); ?>
					<div class="cols cols_2cols about_cols about_cols_2cols clearfix">
                   
                    	<div class="col col_1">
                        	<div class="col_pad">
                            
                            	<div class="sec_nav_wrap">
									<div class="sec_nav_pad">
										<ul class="sec_nav">
										<?php
											// declare custom fields before entering deeper loops
											$vals = get_post_custom_values('news_detail_image',$page->ID);
											$news_detail_image = wp_get_attachment_image_src($vals[0], 'full');
											
											// Signature Listings Page Parent
											$parentID = get_permalink($post->post_parent); 
											$parentPage = get_page($post->post_parent);
											$parentLink = get_permalink($parentPage->ID);
											$parentTitle = get_the_title($parentPage->ID);
						
											
											$parent = 38; // About
											$args=array(
											  'child_of' => $parent
											);
											$pages1 = get_pages($args);  
											if ($pages1) {
											  $pageids = array();
											  foreach ($pages1 as $page) {
												$pageids[]= $page->ID;
											  }
											
											  $args=array(
												'title_li' => '',
												'include' =>  $parent . ',' . implode(",", $pageids)
											  );
											  wp_list_pages($args);
											}
										?> 
										</ul>
									</div>
                                </div>
                                
                                <div class="callout_wrap">
                                	<div class="callout_pad">
                                    	
                                    </div>
                                </div>
                                
                            </div>
                        </div>
                    	
                        <div class="col col_2">
							<?php 
                            	echo '<div class="news_detail clearfix">'; ?>
								
									<div class="news_detail_head detail_head clearfix">
										<span class="back"><?php echo('<a href="'.$parentLink.'" title="Back to '.$parentTitle.'">Back to Real Estate News</a>'); ?></span>
										<span class="printer_friendly">
											<a href="#printer_friendly" title="Printer Friendly Version">Printer Friendly</a>
										</span>
										<span class="bookmark">
											<a href="#add_to_bookmarks" title="Real Estate News - <?php the_title(); ?>">Bookmark</a>
										</span>
									</div>
								
									<?php
									if($news_detail_image[0]) {
										echo('<img class="news_detail_feat_img" src="'.$news_detail_image[0].'" />');
									}
									echo('<h1>');
										the_title();
									echo('</h1>');
									the_content();
									echo($feat_test_content);
								echo '</div>';
                            ?>
                        </div>
						
                    </div>
				<?php endwhile; ?>
             <?php endif; ?>
        </div>

<?php get_footer(); ?>